package cn.doit.config

import java.util.Properties

import com.typesafe.config.{Config, ConfigFactory}

object DolphinConfig {
  /**
    * 解析application.conf配置文件
    */

  private lazy val application: Config = ConfigFactory.load()

  /**  解析运行模式 */
   val _power: String = application.getString("dolphin.common.power")

  /** 解析mysql配置*/
   val _driver: String = application.getString("dolphin.mysql.driver")
   val _url: String = application.getString("dolphin.mysql.url")
   val _username: String = application.getString("dolphin.mysql.username")
   val _password: String = application.getString("dolphin.mysql.password")

  /**mysql的属性参数封装*/
   val props = new Properties()
  props.setProperty("driver",_driver)
  props.setProperty("user",_username)
  props.setProperty("password",_password)

  /**redis的属性参数配置文件 */
  val _redishost = application.getString("dolphin.redis.host")
  val _redisport = application.getInt("dolphin.redis.port")
  val _redisuser = application.getString("dolphin.redis.user")
  val _redispwd = application.getString("dolphin.redis.passwd")

}
